#!python
#
# Info for generating core classes
#
#import pyplusplus.module_builder.call_policies as cp
from pyplusplus.module_builder.call_policies import *
import pygccxml.declarations.type_traits as tt
   

# ------------ Data output and generation --------------- #
# Idea: Generate this from doxygen or opensg fcd files

class ClassInfo:
   def __init__(self, name, excludeList=[], policyList=[], includes=[]):
      self.name = name
      self.excludes = excludeList
      self.policies = policyList
      self.includes = includes

gen_classes = []

ac = ClassInfo("Action")
gen_classes.append(ac)

ac = ClassInfo("DrawActionBase", [], [], [])
gen_classes.append(ac)

ac = ClassInfo("DrawAction", [], [], [])
gen_classes.append(ac)

ac = ClassInfo("RenderActionBase", [], [], [])
gen_classes.append(ac)

ac = ClassInfo("RenderAction", [], [], [])
gen_classes.append(ac)

ac = ClassInfo("IntersectAction", [], [], [])
gen_classes.append(ac)

ra = ClassInfo("RenderAction")
gen_classes.append(ra)

#sfh = ClassInfo("SceneFileHandler",
#                ["getFileType","getReadProgressCB","getPathHandler",
#             "getDefaultGraphOp","getOptions"

ssm = ClassInfo("SimpleSceneManager")
gen_classes.append(ssm)

sc = ClassInfo("StatCollector",
               ["getElem","reset","getValue"])
gen_classes.append(sc)


# --- Node Core's ------ #

class CoreInfo:
   def __init__(self, name, parent, excludeList=[], policyList=[], includes=[], hasBase=True):
      " If parent == None, then no parent. "
      self.name = name
      self.parent = parent
      self.excludes = excludeList
      self.policies = policyList
      self.includes = includes
      self.hasBase = hasBase

# Map from class name to CoreInfo class
core_infos = {}

# fc's that are custom (not in fcd files)
aci = CoreInfo("AttachmentContainer", "FieldContainer", hasBase=False)
core_infos["AttachmentContainer"] = aci

ai = CoreInfo("Attachment", "FieldContainer", hasBase=False)
core_infos["Attachment"] = ai

ni = CoreInfo("Node", "AttachmentContainer", hasBase=False)
core_infos["Node"] = ni

nci = CoreInfo("NodeCore", "AttachmentContainer", hasBase=False)
core_infos["NodeCore"] = nci

# fc's that need customized
image_info = CoreInfo("Image","AttachmentContainer",
                      ["store","restore","getData","getDataByTime","calcMipmapGeometry",
                       "clearHalf"])
core_infos["Image"] = image_info

window_info = CoreInfo("Window","AttachmentContainer",
                      ["getFunction","getFunctionNoCheck","getFunctionByName","unpackIdStatus"])
core_infos["Window"] = window_info

core_ignore_list = ["ClusterWindow", "ImageComposer","DisplayCalibration","MultiDisplayWindow",
                    "SortFirstWindow","SortLastWindow","SepiaComposer","BinarySwapComposer",
                    "PipelineComposer","ParallelComposer","BalancedMultiWindow",
                    "DisplayFilterForeground"]

# Map of core id to callables to call on (class, base) decl
core_mods = {}
core_mods["Slices"] = [ [lambda c: c["Edge"].exclude(), 
                         lambda c: c["Slice"].exclude(),
                         lambda c: c["createSlice"].exclude(),
                         lambda c: c["drawSlices"].exclude()],
                        [] ]
#core_mods["Image"] = [ [lambda c: c["createMipmap"].use_overload_macro = True, ], []]


# ---- Methods ----- #

public_methods = ["getDefaultMaterial","getDefaultUnlitMaterial",
                  "makePlane","makePlaneGeo",
                  "makeCone","makeConeGeo",
                  "makeCylinder","makeCylinderGeo",
                  "makeConicalFrustum","makeConicalFrustumGeo",
                  "makeTorus","makeTorusGeo",
                  "makeSphere","makeSphereGeo",
                  "makeLatLongSphere","makeLatLongSphereGeo",
                  "makeBox","makeBoxGeo",
                  "setName", "getName"]